<template>
  <div>富文本编辑器</div>
  <textarea id="mytextarea">Hello, World!</textarea>
  <el-button @click="publishFn">发表</el-button>
</template>

<script>
export default {
  name: '',
  data() {
    return {}
  },
  mounted() {
    tinymce.init({
      selector: '#mytextarea',
      language: 'zh_CN' //注意大小写
    })
  },
  methods: {
    publishFn() {
      console.log('tinymce', tinymce.activeEditor.getContent())
      // 调用接口,将 富文本编辑器中的内容通过接口提交传递给后端
      // 后端将数据存到数据库中.
    }
  }
}
</script>
<style scoped>
#mytextarea {
  width: 100%;
  height: 500px;
}
.tox-tinymce-aux {
  z-index: 709826033 !important;
}
.tox-tinymce-inline {
  z-index: 709826032 !important;
}
</style>